#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QPushButton>
#include<QFileDialog>
#include<QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    resize(800,600);
    QPushButton*btn=new QPushButton("文件",this);
    QFileDialog*fdlg=new QFileDialog(this);
    connect(btn,&QPushButton::clicked,[=](){
     //  QString str=fdlg->getOpenFileName(this);
        QString str=fdlg->getOpenFileName(this,"文件","C:\\Users","*.jpg");

        qDebug()<<str;
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

